home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / 422mods.zip / 95COLORS.422 < prev    next >
Text File  |  1993-02-09  |  5KB  |  128 lines

  1. 3ST006: 595 colors
  2. Starship Trooper #1 @12754 9═2God9═0
  3. Wed Feb 03 15:12:48 1993
  4. /*
  5.  *Name       : 95 Colors
  6.  *Filename   : ST006.MOD                (alternate: 95color.mod)
  7.  *Description: More colors than you could ever use!
  8.  *Difficulty : Not.
  9.  *Version    : 4.22 (probably compatible with most others)
  10.  *Files      : VARS.H (sorry) XINIT.C COM.C BBSUTL.C WWIVEDIT\CONFIG\*.DEF
  11.  *Author     : Starship Trooper 1@2750 Net  1@12754 Link
  12.  *Date       : Feb 1993
  13.  */
  14.  
  15. This mod will give you 95 colors.  All of them use the "heart code" convention.
  16. That is, they exist after a ^C character in the files, and the color
  17. character is typed after a ^P in the editors, just like the standard 10
  18. colors.  0-9 are the defaults, and I have added A-Z, a-z, and all punctuation
  19. marks between ! (33) and  (127).
  20.  
  21. 1. File VARS.H, add one line with the other __EXTRN__ declarations:
  22.  
  23. __EXTRN__ char colours[96];
  24.  
  25. Note the spelling of "colours".
  26.  
  27. 2. File XINIT.C.  Near the bottom, just before detecting a multitasker, add
  28.    the code to initialize the colours[] array.
  29.  
  30.   strcpy(colours,         /* 33-47 (!-/)  grey backgrounds */
  31.     "\x70\x71\x72\x73\x74\x75\x76\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F");
  32.   strcat(colours,         /* 48-57 (0-9)duplicate the defaults */
  33.     "\x07\x0B\x0E\x05\x1F\x02\x8C\x09\x01\x03");
  34.   strcat(colours,         /* 58-64 (:-@) grey foregrounds */
  35.     "\x17\x47\x57\x67\x28\x38\x68");
  36.   strcat(colours,         /* 65-90 (A-Z) black backgrounds, yellows, whites,
  37.                              black foregrounds, */
  38.     "\x04\x06\x08\x0A\x0C\x0D\x0F\x1E\x2E\x3E\x4E\x5e\x6e\x2f\x3f\x4f\x5f\x6f\x
  39. 10\x20\x30\x40\x50\x60\x1C\x2C");
  40.   strcat(colours,         /* 91-96 ([\]^_`  flashing */
  41.     "\x8B\x8E\x85\x9F\x82\x8C";
  42.   strcat(colours,        /* 97-122 a-z onblu, oncyan, ongrn, onred, undef */
  43.     "\x3C\x12\x13\x14\x15\x16\x18\x1A\x1B\x31\x34\x35\x39\x3A\x3B\x21\x24\x41\x
  44. 43\x49\x4A\x4B\x0F\x0F\x0F\x0F");
  45.   colours[123-33]=0x89; colours[124-33]=0x81; colours[125-33]=0x83;
  46.   colours[126-33]=0xF0; colours[127-33]=0xFF;
  47.  
  48. Note that some of those long strings (over 80 columns) were truncated by the
  49. network, so splice them together.
  50.  
  51. 3. File COM.C. Replace void ansic() with:
  52.  
  53. void ansic(int n)
  54. {
  55.   char c;
  56.   if (n<10) {
  57.      c = ((thisuser.sysstatus & sysstatus_color) ? thisuser.colors[n] :
  58.           thisuser.bwcolors[n]);
  59.   } else {
  60.      c= colours[n-33];
  61.   }
  62.   if (c == curatr)
  63.     return;
  64.   setc(c);
  65.   makeansi((thisuser.sysstatus & sysstatus_color) ? thisuser.colors[0] :
  66.         thisuser.bwcolors[0],endofline, 0);
  67. }
  68.  
  69. 4. Still in COM.C, find void outchr() and replace the beginning with:
  70.  
  71.   int i, i1;
  72.   if (change_color) {
  73.     change_color = 0;
  74.     if ((c >= '0') && (c <= '9')) {
  75.       ansic(c - '0');
  76.     } else {
  77.       ansic(c);
  78.     }
  79.     return;
  80.   }
  81.   if (c == 3) {    /* existing */
  82.  
  83. Now you can decode all 95 colors, with the above steps, using your standard
  84. text editor to embed heart codes.  The following steps will let you use
  85. ^Pwhatever from within the BBS's editors:
  86.  
  87. 5. File BBSUTL.C, void inli(), replace case 16 with:
  88.  
  89.           case 16: /* Ctrl-P */
  90.             if (cp<maxlen-1) {
  91.               ch=getkey();
  92.               s[cp++]=3;
  93.               s[cp++]=ch;
  94.               if ( (ch>='0') && (ch<=9)) {
  95.                    ansic(ch-'0');
  96.               } else ansic(ch);
  97.             }
  98.             break;
  99.  
  100. 6: File WWIVEDIT\CONFIG\*.DEF
  101.  
  102. COLORS: [#33-#127] Legal Color Range (See CONFIG.DOC for format)
  103.  
  104. (To display the colors available, use ^O (help) in WWIVEDIT, then select the
  105. COLORS screen).
  106.  
  107. That's all!  Just do a MAKE, and then use any ASCII non-control character
  108. after a ^C to make a color.  If you don't like the colors I've chosen,
  109. you can change them in XINIT.C.  I tried to pick ones that looked reasonably
  110. good, and had high contrast, and arrange them in a somewhat logical order.
  111. Remember that the codes are case-sensitive - 'a' and 'A' are different colors.
  112. The ones you'll use most frequently are probably A-G.  Punctuation marks
  113. either involve grey (low ASCII values) or are flashing (high ASCII).  Most
  114. capital letters have black backgrounds or white/yellow/black foregrounds,
  115. while lower-case letters generally have less-attractive, lower-contrast
  116. combinations. "wxyz" are reserved for your personal use - I've assigned white
  117. on black to all of those.
  118.  
  119. ≡≡ TrooperWare/WWIV:
  120. [ST001- Random sysop-unavailable      ][ST002- One-key user validation     ]
  121. [ST003- Lock xfers during prime time  ][ST004- numlock light when user on  ]
  122. [ST005- UNIX-like //FINGER            ][ST006- 95 colors                   ]
  123. [ST007- Language switching (currently under construction)                  ]
  124.  
  125. [STRCOM - WWIV 4.22 String Compiler                                        ]
  126.  
  127.                7═════1Starship Trooper 51@2750/127547═════0
  128.